from rest_framework import serializers

from campus.models import *


class CampusOrganizationsManagerSerializer(serializers.ModelSerializer):
    accept = serializers.BooleanField(read_only=True)
    class Meta:
        model = CampusOrganizationsManager
        fields = '__all__'


class CampusOrganizationsSerializer(serializers.ModelSerializer):
    manager_set = CampusOrganizationsManagerSerializer(many=True, read_only=True)
    accept = serializers.BooleanField(read_only=True)

    class Meta:
        model = CampusOrganizations
        fields = '__all__'
        depth = 2


class CampusOrganizationActivityTimelineSerializer(serializers.ModelSerializer):
    class Meta:
        model = CampusOrganizationActivityTimeline
        fields = '__all__'


class CampusOrganizationActivitySerializer(serializers.ModelSerializer):
    timeline_set = CampusOrganizationActivityTimelineSerializer(many=True, read_only=True)

    class Meta:
        model = CampusOrganizationActivity
        fields = '__all__'
